﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace PssFramework
{
    class Utils
    {
        public static DataSet getConfig()
        {
            DataSet ds = new DataSet();
            ds.ReadXml("PssConfig.xml");
             return ds;
        }
        public static void updateHostIpInConfig(string newIp)
        {
            DataSet ds = new DataSet();
            ds.ReadXml("PssConfig.xml");
            ds.Tables[0].Rows[0]["IP"] = newIp;
            ds.WriteXml("PssConfig.xml");
        }
        public static int getValue(byte[] buffer, int startindex)
        {
            int retval = 0;
            byte[] data = new byte[4];
            Buffer.BlockCopy(buffer, startindex, data, 0, 4);
            retval = BitConverter.ToInt32(data, 0);
            return retval;
        }
    }
}
